<!DOCTYPE html >
<html>
<head>
<meta name="Generator" content="ECSHOP v2.7.3" />
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<title>信息修改</title>
<meta name="Keywords" content="" />
<meta name="Description" content="" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<link rel="stylesheet" type="text/css" href="{MODULE_URL}template/mobile/user/css/user.css?T={php echo time()}"/>
<link rel="stylesheet" type="text/css" href="{MODULE_URL}template/mobile/user/css/public.css?T={php echo time()}"/>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<body>
      <header>
      <div class="tab_nav">
        <div class="header">
          <div class="h-left"><a class="sb-back" href="javascript:history.back(-1)" title="返回"></a></div>
          <div class="h-mid">信息修改</div>
          <div class="h-right">
          </div>
        </div>
      </div>
      </header>
<div id="tbh5v0">
  <div class="Personal">
  <div id="tbh5v0">
    <div class="innercontent1" >
      <form method="post" action="" id="edit_profile" onsubmit="return toVaild()">
        <div class="name"><span>真实姓名</span>
          <input type="text" name="realname" value="{if $user['realname']!='0'}{$user['realname']}{/if}" placeholder="*真实姓名" class="c-f-text" id="realname">
        </div>
		<div class="name"><span>昵称</span>
          <input type="text" name="nickname" value="{$user['nickname']}" placeholder="*昵称" class="c-f-text" id="nickname">
        </div>
		<div class="name"><span>手机号码</span>
          <input type="num" name="mobile" value="{if $user['mobile']!='0'}{$user['mobile']}{/if}" placeholder="*手机号码" class="c-f-text" id="mobile" maxlength='11'>
        </div>
        <div class="name1"> <span>性　别</span>
          <ul>
            <li  {if $user['sex']=='0'}class="on"{/if}  >
              <label for="sex0">
               <input type="radio" name="sex" value="0" tabindex="2" class="radio" id="sex0" {if $user['sex']=='0'}checked=true{/if}/>
                保密</label>
            </li>
            <li  {if $user['sex']=='1'}class="on"{/if} >
              <label for="sex1">
                <input type="radio" name="sex" value="1"  tabindex="3" class="radio" id="sex1" {if $user['sex']=='1'}checked=true{/if} />
                男</label>
            </li>
            <li  {if $user['sex']=='2'}class="on"{/if} >
              <label for="sex2">
                <input type="radio" name="sex" value="2"  tabindex="4" class="radio" id="sex2" {if $user['sex']=='2'}checked=true{/if}/>
                女</label>
            </li>
          </ul>
        </div>
		<div class="name"><span>家庭地址</span>
          <input type="text" name="address" value="{if $user['address']!='0'}{$user['address']}{/if}" placeholder="*家庭地址" class="c-f-text" id="address">
        </div>
        <div class="field submit-btn">
          <input type="submit" value="确认修改" class="btn_big1" />
        </div>
        <input type="hidden" name="act" value="act_edit_profile"/>
      </form>
    </div>
  </div>
</div>
<script type="text/javascript">
    $('.name1 ul li').click(function(){
		$(this).find("input").attr("checked","checked");
		$('.name1 ul li').removeClass("on");
		$(this).addClass("on");
	})
	function toVaild(){
            var nickname = $("#nickname").val();
			var realname = $("#realname").val();
			var mobile = $("#mobile").val();
			var address = $("#address").val();
			if("undefined"==nickname || ""==nickname){
				alert('请输入你的昵称');
				return false;
			}
			if("undefined"==realname || ""==realname){
				alert('请输入你的真实姓名');
				return false;
			}
			if("undefined"==address || ""==address){
				alert('请输入你的联系地址');
				return false;
			}
			var sex = $('input:radio[name="sex"]:checked').val();
			if("undefined"==sex || ""==sex){
				alert('请选择你的性别');
				return false;
			}
			var telreg = /^1[3|4|5|7|8][0-9]\d{8}$|^\d{8}$/;
			if(!telreg.test(mobile)){
				alert('请输入正确的手机号码');
				return false;
			}
			
    }
 </script>								
</div>
</body>
</html>